package com.muyu.system.service.impl;

import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.DateUtils;
import com.muyu.system.domain.DanmoUserShop;
import com.muyu.system.mapper.DanmoUserShopMapper;
import com.muyu.system.req.DanmoUserShopReq;
import com.muyu.system.service.IDanmoUserShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品关注Service业务层处理
 *
 * @author yangle
 * @date 2024-09-28
 */
@Service
public class DanmoUserShopServiceImpl implements IDanmoUserShopService
{
    @Autowired
    private DanmoUserShopMapper danmoUserShopMapper;

    /**
     * 查询商品关注
     *
     * @param id 商品关注主键
     * @return 商品关注
     */
    @Override
    public DanmoUserShop selectDanmoUserShopById(Long id)
    {
        return danmoUserShopMapper.selectDanmoUserShopById(id);
    }

    /**
     * 查询商品关注列表
     *
     * @param danmoUserShop 商品关注
     * @return 商品关注
     */
    @Override
    public List<DanmoUserShop> selectDanmoUserShopList(DanmoUserShop danmoUserShop)
    {
        return danmoUserShopMapper.selectDanmoUserShopList(danmoUserShop);
    }

    /**
     * 新增商品关注
     *
     * @param danmoUserShop 商品关注
     * @return 结果
     */
    @Override
    public int insertDanmoUserShop(DanmoUserShop danmoUserShop)
    {
        danmoUserShop.setCreateTime(DateUtils.getNowDate());
        return danmoUserShopMapper.insertDanmoUserShop(danmoUserShop);
    }

    /**
     * 修改商品关注
     *
     * @param danmoUserShop 商品关注
     * @return 结果
     */
    @Override
    public int updateDanmoUserShop(DanmoUserShop danmoUserShop)
    {
        danmoUserShop.setUpdateTime(DateUtils.getNowDate());
        return danmoUserShopMapper.updateDanmoUserShop(danmoUserShop);
    }

    /**
     * 批量删除商品关注
     *
     * @param ids 需要删除的商品关注主键
     * @return 结果
     */
    @Override
    public int deleteDanmoUserShopByIds(Long[] ids)
    {
        return danmoUserShopMapper.deleteDanmoUserShopByIds(ids);
    }

    /**
     * 删除商品关注信息
     *
     * @param id 商品关注主键
     * @return 结果
     */
    @Override
    public int deleteDanmoUserShopById(Long id)
    {
        return danmoUserShopMapper.deleteDanmoUserShopById(id);
    }


}
